package com.lsl.test;

import cn.hutool.core.io.resource.ResourceUtil;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

/**
 * @author lishuailong
 * @create 2020-07-09 17:23
 */
public class test2 {
    public static void main(String[] args) {
        Properties properties = new Properties();
        FileInputStream fileInputStream = null;
        try {
            fileInputStream = new FileInputStream("lsl.properties");
            properties.load(fileInputStream);
            System.out.println(properties.getProperty("name"));
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            if (fileInputStream!=null){
                try {
                    fileInputStream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

        String str = ResourceUtil.readUtf8Str("lishuailong.properties");
        System.out.println("str = " + str);
    }
}
